package com.controller.setting;

import com.comm.R;
import com.comm.vo.ProjectTableVo;
import com.entity.DrugTable;
import com.entity.ProjectTable;
import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@RequestMapping(value = "/systemProject")
@Controller
@Api(value = "检查项目字典表test",tags = "检查项目字典表API")
@ApiResponses({
        @ApiResponse(code=200,message="请求成功"),
        @ApiResponse(code=404,message="找不到页面"),
        @ApiResponse(code=403,message="请求禁止"),
        @ApiResponse(code=401,message="请求未授权"),
        @ApiResponse(code=500,message="后台服务错误")})
public class SystemProject {
    //1.4.2：查找所有的检查项目字典表
    @ResponseBody
    @RequestMapping(value ="/fundProject",method = RequestMethod.GET)
    @ApiOperation(value = "查找所有的检查项目字典表的接口",notes = "所有的检查项目字典表",httpMethod = "post", response = String.class)
    public  R fundProject(){
        R r = new R();
        r.setCode(200);
        r.setMsg("你好棒，查到了");
        String data = "[{\n" +
                "   \"id\": 100001,\n" +
                "   \"projectName\": \"澳门首家\",\n" +
                "   \"projectSource\": \"自建\",\n" +
                "   \"projectRemark\": \"没有备注\"\n" +
                "  },{\n" +
                "   \"id\": 100001,\n" +
                "   \"projectName\": \"打王者\",\n" +
                "   \"projectSource\": \"自建\",\n" +
                "   \"projectRemark\": \"没有备注\"\n" +
                "  },{\n" +
                "   \"id\": 100001,\n" +
                "   \"projectName\": \"打豆豆\",\n" +
                "   \"projectSource\": \"自建\",\n" +
                "   \"projectRemark\": \"没有备注\"\n" +
                "  }\n" +
                " ]";
        r.setData(data);
        return r;
    }
    //   1.4.3：添加检查项目字典表的接口：
    @ResponseBody
    @RequestMapping(value ="/addProject",method = RequestMethod.POST)
    @ApiOperation(value = "添加检查项目字典表的接口",notes = "添加检查项目字典表",httpMethod = "post", response = String.class)
    @ApiImplicitParam(name = "projectName",value = "名称",required = true,dataType = "string",paramType = "query")
    public  R addProject(@RequestParam("projectName") String projectName){
        R r = new R();
        r.setCode(200);
        r.setMsg("你好棒，添加成功");
        String data = "";
        r.setData(data);
        return r;
    }
    // 1.4.4：编辑检查项目字典表的接口：
    @ResponseBody
    @RequestMapping(value ="/editProject",method = RequestMethod.POST)
    @ApiOperation(value = "编辑检查项目字典表的接口",notes = "编辑检查项目字典表",httpMethod = "post", response = String.class)
    public  R editProject(@RequestBody @ApiParam(name = "实体类",value = "projectTable") ProjectTableVo projectTable){
        R r = new R();
        r.setCode(200);
        r.setMsg("你好棒，编辑成功");
        String data = "";
        r.setData(data);
        return r;
    }
    // 1.4.5：删除检查项目字典表的接口：
    @ResponseBody
    @RequestMapping(value ="/delProject",method = RequestMethod.POST)
    @ApiOperation(value = "删除检查项目字典表的接口",notes = "检查项目字典表的接口",httpMethod = "post", response = String.class)
    @ApiImplicitParam(name = "id",value = "主键id",required = true,dataType = "int",paramType = "query")
    public  R delProject(@RequestParam(name = "id")Integer id){
        R r = new R();
        r.setCode(200);
        r.setMsg("你好棒，删除成功");
        String data ="";
        r.setData(data);
        return r;
    }
}
